<?php
session_start();
function __autoload($class_name) {
    $file_name = $class_name . '.php';
    if (file_exists($file_name)) {
        require $file_name;
    } else {
        $folder = array('controller', 'model');
        foreach ($folder as $v) {
            $file = $v . '/' . $class_name . '.php';
            if (file_exists($file)) {
                require_once $file;
            }
        }
    }
}
